﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplication
{
    public partial class IdentifyingCode : Form
    {
        public IdentifyingCode()
        {
            InitializeComponent();
        }

        private void IdentifyingCode_Load(object sender, EventArgs e)
        {
            Bitmap bt = new Bitmap(200, 50);
            Graphics gp = Graphics.FromImage(bt);
            Random ran = new Random();
            Point p1 = new Point(20, 20);
            gp.FillRectangle(new SolidBrush(Color.YellowGreen), 0, 0, 100, 40);
            StringBuilder sb = new StringBuilder();
            string s = "qwertyuiop1234QWERTYUIOPasdfghjkl5678ASDFGHJKLzxcvbnm90ZXCVBNM";
            for (int i = 0; i < 5; i++)
            {
                string s1 = s.Substring(ran.Next(s.Length - 1), 1);

                gp.DrawString(s1, new Font("fontName", 17, FontStyle.Bold | FontStyle.Italic),
                    new SolidBrush(Color.White), (i * 17), (ran.Next(0, 20)));

                sb.Append(s1);
            }

            // draw 400 points
            for (int j = 0; j < 400; j++)
            {
                gp.DrawPie(new Pen(new SolidBrush(Color.Blue), 1), ran.Next(1, 100), ran.Next(1, 40), 1, 1, 180, 30);
            }


            //draw 5 line randomly
            for (int j = 0; j < 5; j++)
            {
                gp.DrawLine(new Pen(new SolidBrush(Color.Blue), 1), new Point(ran.Next(0, 100), ran.Next(0, 40)), new Point(ran.Next(0, 100), ran.Next(0, 40)));
            }

            this.pictureBox1.Image = bt;
            gp.Dispose();
        }
    }
}
